<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <script type="text/javascript">
        function showTime() {
            var today = new Date();
            var h = today.getHours();
            var m = today.getMinutes();
            var s = today.getSeconds();
            //document.write(m);
            // add a zero in front of numbers less than 10
            m = checkTime(m);
            s = checkTime(s);
            document.getElementById('txt').innerHTML = h + ":" + m + ":" + s;
            t=setTimeout('showTime()',500);
        }

        function checkTime(i) {
            if ( i < 10 ) {
                i = "0" + i;
            }
            return i;
        }
    </script>
	<title></title>
</head>
<body onload=showTime()>
    <div id="txt"></div>
    <hr />
    <script type="text/javascript">
        //return today's date
        var d = new Date();
        document.write(d);
        document.write("<br />");
        document.write(d.getTime() + " milliseconds since 1970/01/01");
        document.write("<br />");
        document.write("To string (UTC): ");
        document.write("<br />");
        document.write(d.toUTCString());
        document.write("<br />");
        document.write(d.getDay());
        document.write("<br />");
        document.write("set time");
        document.write("<br />");
        d.setFullYear(2010,0,31);
        document.write(d);
        document.write("<br />");
        document.write(d.getDay());
        document.write("<br />");
    </script>
    <hr />
    <p> show 10 days in the future</p>
    <script type="text/javascript">
        var myDate = new Date();
        document.write(myDate);
        document.write("<br />");
        myDate.setDate(myDate.getDate() + 10);
        document.write(myDate);
        document.write("<br />");
    </script>
    
    <script type="text/javascript">
        var myDate = new Date();
        myDate.setFullYear(2012,11,22);

        var today = new Date();

        if (myDate > today) {
            alert("Today is before 22nd Dec 2012");
        }
        else {
            alert("Today is after 22nd Dec 2010");
        }


    </script>

    <!--
    <input type="button" value="Show time" onClick=showTime() />
    -->
	
</body>
</html>
